# -*- coding: utf-8 -*-
# @Time    : 2024/1/4 21:21
# @Author  : micah
# @File    : 12.查询历史请求.py
# @Software: PyCharm


import requests

headers = {
    "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1"
}

response = requests.get('https://www.360buy.com/', headers=headers)

# history: 历史请求, 返回的是一个列表, 列表中的元素是response对象
history_list = response.history
for h in history_list:
    print(h.status_code, h.url, h.headers)

print(response.url, response.status_code, response.headers)



